import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Test09 {
	private void mail(String content) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		sdf.setTimeZone(TimeZone.getTimeZone("GMT-8"));
		
		Calendar now =Calendar.getInstance();
		System.out.println(now.get(Calendar.DAY_OF_MONTH));
		
		System.out.println(sdf.format(now.getTime()));
		
	}
	public static void main(String[] args) {
//		System.out.println(10&7);
		Test09 a = new Test09();
		a.m();
		
	}

	private void m(){
		Pattern p = Pattern.compile("([A-Z]+)(\\d+)");
		Matcher m = p.matcher("MMS01118403");
		Integer no = 1;
		if (m.matches()) {
			m.reset();
			while (m.find()) {
				no = Integer.parseInt(m.group(2));
			}
		}
		System.out.println(no);
	}
}